package com.lktx.sso.controller;

import cn.hserver.core.ioc.annotation.Autowired;
import cn.hserver.plugin.web.annotation.Controller;
import cn.hserver.plugin.web.annotation.GET;
import cn.hserver.plugin.web.annotation.POST;
import cn.hserver.plugin.web.interfaces.HttpResponse;
import com.lktx.sso.service.JwtService;

@Controller
public class JwtController {

    @Autowired
    private JwtService jwtService;


    @GET("/jwt/{appId}/sso")
    public void sso(String appId, HttpResponse response) {
        jwtService.checkLogin(appId,response);
    }

    @POST("/jwt/{appId}/login")
    public void ssoLogin(String appId,String name,String pwd,String clientId, HttpResponse response) {
        jwtService.doLogin(appId,clientId,name,pwd,response);
    }

}
